<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CommonFinancialFlow extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        // 1：订单收入，2：充值收入，3：提现支出，4：退款支出
        Schema::dropIfExists('common_financial_flow');
        Schema::create('common_financial_flow', function (Blueprint $table){
            $table->comment = "公共财物流水表";
            $table->increments('id')->comment("ID");
            $table->integer('uid')->comment("用户");
            $table->string("no")->comment("流水号");
            $table->tinyInteger("type")->comment("收支类型");
            $table->decimal("price")->comment("金额");
            $table->decimal("balance")->comment("余额");
            $table->integer('external_id')->comment("业务ID");
            $table->integer('external_app')->comment("y业务模块");
            $table->integer('create_time')->comment("创建时间");
            $table->integer('update_time')->comment("更新时间");
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
